#include "formatter.h"

const char* getUserName(const char* name)
{
	if(strlen(name)>0)	
		return base64_encode(name);	
	return NULL;
}

const char* getPassword(const char* passwd)
{
	if(strlen(passwd)>0)	
		return base64_encode(passwd);		
	return NULL;
}

const char* getDstFormatAddr(char * _dst, const char* dst)
{	
	sprintf(_dst, "RCPT TO:<%s>\r\n", dst);
	return _dst;
}

const char* getSenderFormatAddr(char* _dst, const char* sender)
{
	sprintf(_dst, "MAIL FROM:<%s>\r\n", sender);
	return _dst;
}

const char* getFormatText(char *formatText, 
											const char* title, 
											const char *content,
											const char *sender,
											const char *dst)

{
	sprintf(formatText, "from:%s\nto:%s\nsubject:%s\n\n%s\r\n.\r\n", sender, dst, title, content);
	return formatText;
}


